package com.lct.d6_static_singleinstance;

public class A {
    //2.定义一个静态变量用于记住类的唯一对象
    private static A a = new A();



    //1.私有构造器
    private A(){
    }

    //3.提供静态方法返回这个唯一对象
    public static A getInstance(){
        return a;
    }

}
